package com.aaa.custom.WeChat_Pay.payController;

import com.aaa.util.PayUtil;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * fileName:WechatPayment
 * description:
 * author:zxh
 * createTime:2020/3/14 10:33
 * version:1.0.0
 */
@RestController
@RequestMapping("testJenkins")
public class WechatPayment {
    @RequestMapping("pay")
    public JSONObject pay(@RequestParam("orderId")String orderId,
                          @RequestParam(name = "openid") String openid, HttpServletRequest request){
        JSONObject jsonObject = PayUtil.wxPay(orderId,openid, request);
        return jsonObject;
    }
}
